function GetACLBase() {

	var myData = [
			['1', "启用", 'telnet基线', 'telnet基线描述','放行','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['2', "启用", 'ftp基线', 'ftp基线描述','拦截','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['3', "启用", 'telnet基线', 'telnet基线描述','放行','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['4', "启用", 'sftp基线', 'sftp基线描述','放行','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['5', "启用", 'http基线', 'http基线描述','拦截','详细内容','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2']
	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'status'
						}, {
							name : 'name'
						}, {
							name : 'desc'
						}, {
							name : 'action'
						}, {
							name : 'context'
						}, {
							name : 'createtime'
						}, {
							name : 'creator'
						}, {
							name : 'modifytime'
						}, {
							name : 'modifier'
						}]
			});
			



	store.loadData(myData);
	var nowpage = new Ext.Toolbar.TextItem('1');
	var countpage = new Ext.Toolbar.TextItem('共1页');
	var now_page = 0;
	var count_page = 0;
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '状态',
							width : 100,
							sortable : true,
							dataIndex : 'status'
						}, {
							header : '名称',
							width : 100,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '描述',
							width : 150,
							sortable : true,
							dataIndex : 'desc'
						}, {
							header : '动作',
							width : 70,
							sortable : true,
							dataIndex : 'action'
						}, {
							header : '明细',
							width : 100,
							sortable : true,
							dataIndex : 'context'
						}, {
							header : '创建时间',
							width : 150,
							sortable : true,
							dataIndex : 'createtime'
						}, {
							header : '创建者',
							width : 100,
							sortable : true,
							dataIndex : 'creator'
						}, {
							header : '修改时间',
							width : 150,
							sortable : true,
							dataIndex : 'modifytime'
						}, {
							header : '修改者',
							width : 100,
							sortable : true,
							dataIndex : 'modifier'
						}],
				sm : sm,
				tbar : [{
							text : '添加',
							tooltip : '添加',
							iconCls : 'add',
							handler : function() {
								SetACLBase();
							}
						}, '-', {
							text : '编辑',
							tooltip : '编辑',
							iconCls : 'modify',
							ref : '../modifyBtn',
							id:'modifyBtn',
							name:'modifyBtn',
							handler : function() {
								SetACLBase();
							}
						}, '-', {
							text : '删除',
							tooltip : '删除',
							iconCls : 'delete',
							ref : '../removeBtn',
							disabled : true,
							handler : function() {
								var s = grid.getSelectionModel().getSelections();
								for (var i = 0; r = s[i]; i++) {
									store.remove(r);
								}
							}
						}, '-', {
							text : '查找',
							tooltip : '查找',
							iconCls : 'search',
							handler : function() {							
							}
						}, '-', {
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {							
								store.loadData(myData);
							}
						}],
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'aclbasegrid'
			});
	grid.getSelectionModel().on('selectionchange', function(sm) {
				grid.removeBtn.setDisabled(sm.getCount() < 1);
			});


	
	
	return grid;
}	

function SetACLBase(setReturn){

	var states = [
		['1', '全部时间'],
		['2', '上班时间'],
		['3', '下班时间']
		];
	var states1 = [
		['1', '放行'],
		['2', '拦截']
		];
	var states2 = [
		['1', 'ALL'],
		['2', 'TCP'],
		['3', 'UDP']
		];

	var set_center = {
		xtype: 'fieldset',
		margins:'5 5 5 5',
		layout : 'form',
		region:'center',
		bodyStyle : 'padding:10px;',
		items: [
						{
									xtype: 'checkbox',
									name: 'status',
									id  : 'status',
									fieldLabel: '是否启用',
									anchor: '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '名称',
								id : 'name',
								name : 'name',
								anchor : '100%'
						},{
								xtype : 'textarea',
								fieldLabel : '描述',
								id : 'desc',
								name : 'desc',
								anchor : '100%'
						},{
								fieldLabel: '动作',
								xtype : 'combo',
								name : 'action',
								frame : true,
								id : 'action',
								store : new Ext.data.ArrayStore({
										fields : ['abbr', 'state'],
										data : states1
									}),
								valueField : 'abbr',
								displayField : 'state',
								typeAhead : true,
								mode : 'local',
								triggerAction : 'all',
								value : '1',
								editable : false,
								anchor: '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '源对象',
								id : 'srcip',
								name : 'srcip',
								anchor : '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '源服务',
								id : 'srcmask',
								name : 'srcmask',
								anchor : '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '目的对象',
								id : 'destip',
								name : 'destip',
								anchor : '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '目的服务',
								id : 'destmask',
								name : 'destmask',
								anchor : '100%'
						}
	
		]
	};

	var setWindows = new Ext.Window({
				layout : 'border',
				width : 600,
				height : 500,
				title : "添加业务安全基线",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'hazard',
				items : [set_center],
				plain : true
				
			});
	setWindows.addButton({
				text : "确定",
				handler : function() {
					setWindows.close();
				}
			});
	setWindows.addButton({
				text : '取 消',
				handler : function() {
					setWindows.close();
				}
			});
	setWindows.show();
}

function SetACLBaseTest(){
	
	
	 var store1 = new Ext.data.JsonStore({
        fields: [{name: 'check'},{name: 'x',type: 'int'}],
        data: [
        {check: '设备1',x: 5},
        {check: '设备2',x: 3},
        {check: '设备3',x: 4},
        {check: '设备4',x: 5},
        {check: '设备5',x: 6}
        ]
    })
	var myData = [
			['1', '1', '设备1','inside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>All-Inside-Subnets","<img src='../images/terminal.png'>Corp-Mail-Server","<img src='../images/tcp.png'>Mail_Services","<img src='../images/tick.png'>Permit","","Alerts","","Allow individual hosts to vpn to partner services",'2,3','冲突'],
			['2', '2', '设备1','inside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>FTP_Servers_inside<br><img src='../images/terminallist.png'>Web_Servers_group","<img src='../images/terminal.png'>10.0.101.0/24<br><img src='../images/terminal.png'>10.0.102.0/24<br><img src='../images/terminal.png'>10.0.100.0/24<br><img src='../images/terminal.png'>10.0.103.0/24<br><img src='../images/terminal.png'>10.0.104.0/24","<img src='../images/tcp.png'>ftp<br><img src='../images/tcp.png'>http<br><img src='../images/tcp.png'>https<br><img src='../images/tcp.png'>ssh","<img src='../images/delete.png'>Deny","","Critical","","",'1,3','冲突'],
			['3', '3', '设备1','inside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>inside-network/24","<img src='../images/terminal.png'>10.1.100.0/24","<img src='../images/tcp.png'>ftp","<img src='../images/tick.png'>Permit","","Warnings","","",'2,1','冲突'],
			['4', '1', '设备2','outside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>WWW_Server","<img src='../images/tcp.png'>http","<img src='../images/tick.png'>Permit","","Warnings","","",'3','冲突'],
			['5', '2', '设备2','outside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>DMZ-network","<img src='../images/tcp.png'>http","<img src='../images/tick.png'>Permit","","Warnings","","",'1','冲突'],
			['6', '3', '设备2','outside', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>outside-network/24","<img src='../images/terminal.png'>Ftp_Server","<img src='../images/tcp.png'>ftp","<img src='../images/tick.png'>Permit","","Warnings","","",'2','冲突'],
			['7', '1', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>Remote-net-groups","<img src='../images/terminal.png'>Web_Server_group","<img src='../images/tcp.png'>HTTP-services","<img src='../images/tick.png'>Permit","","Warnings","","",'2,3','冲突'],
			['8', '2', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>10.1.100.0/24","<img src='../images/terminal.png'>FTP_Server_group","<img src='../images/tcp.png'>ftp","<img src='../images/delete.png'>Deny","","Warnings","","",'1,3','冲突'],
			['9', '3', '设备3','partner-dmz', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>partner-dmz-network","<img src='../images/terminal.png'>Web_Server_group","<img src='../images/tcp.png'>ip","<img src='../images/tick.png'>Permit","","Warnings","","",'1,2','冲突'],
			['10', '1','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>Cisco","<img src='../images/tcp.png'>HTTP-services","<img src='../images/tick.png'>Permit","","Warnings","","",'3','冲突'],
			['11', '2','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>Youtube","<img src='../images/tcp.png'>HTTP-services","<img src='../images/delete.png'>Deny","","Warnings","","Marketing, and one of the sales people need access to Youtube for posting product videos",'3','冲突'],
			['12', '3','设备4', 'Global', '<input type="checkbox" checked> ', "<img src='../images/terminallist.png'>any","<img src='../images/terminal.png'>Facebook","<img src='../images/tcp.png'>HTTP-services","<img src='../images/tick.png'>Permit","","Warnings","","Allow only employees to visit Facebook",'2','冲突']
	];



		
   // shared reader
    var reader = new Ext.data.ArrayReader({}, [
       			{
							name : 'id'
						}, {
							name : 'index'
						}, {
							name : 'devices'
						}, {
							name : 'type'
						}, {
							name : 'Enabled'
						}, {
							name : 'Source'
						}, {
							name : 'Destination'
						}, {
							name : 'Service'
						}, {
							name : 'Action'
						}, {
							name : 'Hits'
						}, {
							name : 'Logging'
						}, {
							name : 'Time'
						}, {
							name : 'Description'
						}, {
							name : 'relational'
						}, {
							name : 'status'
						}
    ]);

    var store = new Ext.data.GroupingStore({
            reader: reader,
            data: myData,
            sortInfo:{field: 'id', direction: "ASC"},
            groupField:'devices'
        });



	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [{
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '#',
							width : 10,
							sortable : true,
							dataIndex : 'index'
						}, {
							header : '设备',
							width : 70,
							sortable : true,
							dataIndex : 'devices'
						}, {
							header : 'interface',
							width : 70,
							sortable : true,
							dataIndex : 'type'
						}, {
							header : 'Source',
							width : 70,
							sortable : true,
							dataIndex : 'Source'
						}, {
							header : 'Destination',
							width : 100,
							sortable : true,
							dataIndex : 'Destination'
						}, {
							header : 'Service',
							width : 70,
							sortable : true,
							dataIndex : 'Service'
						}, {
							header : 'Action',
							width : 30,
							sortable : true,
							dataIndex : 'Action'
						}, {
							header : 'Hits',
							width : 30,
							sortable : true,
							dataIndex : 'Hits'
						}, {
							header : 'Logging',
							width : 50,
							sortable : true,
							dataIndex : 'Logging'
						}, {
							header : 'Time',
							width : 50,
							sortable : true,
							dataIndex : 'Time'
						}, {
							header : 'Description',
							width : 70,
							sortable : true,
							dataIndex : 'Description'
						}, {
							header : '相关项',
							width : 70,
							sortable : true,
							dataIndex : 'relational'
						}, {
							header : '状态',
							width : 70,
							sortable : true,
							dataIndex : 'status'
						}],
				sm : sm,
				view: new Ext.grid.GroupingView({
		            forceFit:true,
		            startCollapsed : false ,
		            groupTextTpl: '{gvalue}'
		        }),
				
				
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				region : 'center',
				stateId : 'testgrid'
			});
		
	var centerPanel = new Ext.Panel({
        
        region : 'center',
        layout : 'border',
        tbar : [ {
							text : '导出',
							tooltip : '导出',
							iconCls : 'out',
							handler : function() {							
							}
						}],
        items: [
        		{
							region: 'north',
							height: 300,
							items : {
						    xtype: 'stackedcolumnchart',
						    store: store1,
						    xField: 'check',
						    xAxis: new Ext.chart.CategoryAxis({
						        title: '设备'
						    }),
						    yAxis: new Ext.chart.NumericAxis({
						        title: "数量"
						    }),
						    series: [{
						        displayName: "数量",
						        yField: 'x'
						    }],
						    chartStyle: {
						        padding: 10,
						        legend: {
						            display: 'right'
						        }
						    }
							}
							
						},{
							region: 'center',
							layout : 'fit',
							title:'明细表格',
							items : [grid]
						}
        ]

			});
    
    
	
	var setWindows = new Ext.Window({
				layout : 'border',
				width: 900,
        height: 650,
				title : "业务安全基线检测",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'hazard',
				items : [centerPanel],
				plain : true
				
			});
	
	setWindows.show();
}